import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.annotation.WebServlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.util.ArrayList;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.BarRenderer3D;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.VerticalAlignment;




public class score extends HttpServlet {

        public score() {
                super();
        }

        /**
         * Destruction of the servlet. <br>
         */
        public void destroy() {
                super.destroy(); // Just puts "destroy" string in log
                // Put your code here
        }

        /**
         * The doPost method of the servlet. <br>
         *
         * This method is called when a form has its tag value method equals to post.
         * 
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         */
        public void doPost(HttpServletRequest request, HttpServletResponse response)
                        throws ServletException, IOException {

                response.setCharacterEncoding("utf-8");
                String name=request.getParameter("name");
            String pwd=request.getParameter("password");
        String[] strs=null;

                GradesCatcher hh=new GradesCatcher();
                hh.setStu_id(name);
                hh.setStu_pwd(pwd);
            ArrayList<String[]> arraylist=null;    
            try {
				arraylist = hh.parseHtml();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
        
            request.setAttribute("list",arraylist);
            
            request.getRequestDispatcher("person00.jsp").forward(request,response);
        }
        
       
}
